{
  "properties" : { },
  "id" : "8e006cdcd438466e812d168be7e30705",
  "script" : null,
  "groupId" : "14a6522e401e4787ac0d0ba873100d98",
  "name" : "获取数据库驱动类型",
  "createTime" : null,
  "updateTime" : 1671004218626,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "/getDriver",
  "description" : null,
  "returnType" : null,
  "mappingPath" : null,
  "parameters" : [ {
    "name" : "datasource",
    "value" : null,
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ]
}
================================

import org.ssssssss.magicapi.datasource.model.MagicDynamicDataSource

url = MagicDynamicDataSource.getDataSource(datasource).getDataSource().getUrl()
if (url.toLowerCase().startsWith("jdbc:postgresql")) { //postgresql
    return "postgresql"
} else if (url.toLowerCase().startsWith("jdbc:mysql")) { //mysql
    return "mysql"
}

// var version = datasource.selectValue("""
//     select version()
// """)
// if (version.toLowerCase().startsWith("postgresql")) { //postgresql
//     return "postgresql"
// } else { //默认为mysql
//     return "mysql"
// }